package com.example.xd.sdk_test;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.example.xd.sdk_model.TestFragment;
import com.example.xd.sdk_model.sdkTest;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.test1).setOnClickListener(this);
        findViewById(R.id.test2).setOnClickListener(this);
        getSupportFragmentManager().beginTransaction().add(R.id.fl, new TestFragment()).commit();

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.test1:
                int add = sdkTest.add(2, 4);
                Log.i("xd-----", add + "");

                break;
            case R.id.test2:
                int mult = sdkTest.mult(2, 4);
                Log.i("xd-----", mult + "");
                break;
        }
    }
}
